home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PRINTER
/
MEXLAS.ARJ
/
TXCLNDAR.PRG
< prev
next >
Wrap
Text File
|
1991-09-01
|
3KB
|
129 lines
*:*********************************************************************
*:
*: Program: TXCLNDAR.PRG
*:
*: System: Texas Associated Software Laser Library
*: Author: Jose E. Lopez, Jr.
*: Copyright (c) 1991, Texas Associated Software - Red Oak, TX
*:
*:*********************************************************************
* There are many ways to code this example. This example is coded simply
* to show the use of The Library not TexAS coding style. Thanks - JEL
txinit(_print_port)
txreset()
txpagesize("letter")
txorient("L")
txsetlpi(6)
txcolbox(01, 01, 105, 44, 1) && DRAW CALENDAR BORDER
txcolbox(01, 01, 105, 02, 1) && DRAW BORDER FOR MONTH NAME
_month = cmonth(Date()) && CHARACTER MONTH NAME
_year = str(year(Date()),4) && CHARACTER YEAR
_mo_yr = _month + " " + _year
_col = (105 - len(Alltrim(_mo_yr))) / 2
txcolprint(02, _col, .t., _mo_yr)
txcolprint(04, 05, .t., "Sunday")
txcolprint(04, 20, .t., "Monday")
txcolprint(04, 35, .t., "Tuesday")
txcolprint(04, 48, .t., "Wednesday")
txcolprint(04, 63, .t., "Thursday")
txcolprint(04, 80, .t., "Friday")
txcolprint(04, 94, .t., "Saturday")
DECLARE week1_[7], week2_[7], week3_[7], week4_[7], week5_[7]
for i = 1 to 5
_array = "week"+str(int(i),1)+"_"
for i2 = 1 to 7
&_array[i2] = " "
Next
Next
txcolbox(03, 01, 105, 02, 1, 10) && DRAW BORDER FOR DAYS OF WEEK
for i = 13 to 103 step 15
for X = 05 to 40 step 8
txcolbox(X, i, 03, 02, 1) && DRAW DAY OF MONTH BOX
Next
Next
for i = 1 to 105 step 15
txcolbox(03, i, 15, 02, 1) && DRAW DAY DIVIDING COLUMNS
txcolbox(05, i, 15, 40, 1) && DRAW DAY DIVIDING COLUMNS
Next
for i = 5 to 40 step 8
txcolbox(i, 01, 105, 8, 1) && DRAW DAY DIVIDING ROWS
Next
_bom = day(Date() - day(Date()) + 1)
_bdom = Date() - day(Date()) + 1
_bndom = dow(_bdom)
if month(Date()) = 12 && CHECK FOR DECEMBER
_eom = ctod("01/01" + substr(str(year(Date()) + 1, 4), 3, 2) - 1)
else
_eom = substr(str(month(Date()) + 1, 2), 1, 2)
_eom = _eom + "/01/" + substr(str(year(Date()), 4), 3, 2)
_ndays = day(ctod(_eom) - 1)
_deom = ctod(_eom) - 1
endif
i = 1
for i2 = _bndom to 7
week1_[i2] = str(i, 2)
i = i + 1
Next
for i2 = 1 to 7
week2_[i2] = str(i, 2)
i = i + 1
Next
for i2 = 1 to 7
week3_[i2] = str(i, 2)
i = i + 1
Next
for i2 = 1 to 7
if i <= _ndays
week4_[i2] = str(i, 2)
endif
i = i + 1
Next
if i <= _ndays
for i2 = 1 to 7
if i <= _ndays
week5_[i2] = str(i, 2)
endif
i = i + 1
Next
endif
if i <= _ndays
for i2 = 1 to 7
if i <= _ndays
week1_[i2] = str(i, 2)
endif
i = i + 1
Next
endif
i2 = 1
for i = 6 to 42 step 8
_array = "week"+str(int(i2),1)+"_"
txcolprint(i, 13, .t., &_array[1])
txcolprint(i, 28, .t., &_array[2])
txcolprint(i, 43, .t., &_array[3])
txcolprint(i, 58, .t., &_array[4])
txcolprint(i, 73, .t., &_array[5])
txcolprint(i, 88, .t., &_array[6])
txcolprint(i,103, .t., &_array[7])
i2 = i2 + 1
Next
txclear()
*: EOF: TXCLNDAR.PRG